<?php
// 应用公共文件
//响应
if(!function_exists('responses')){
    function responses($code,$msg,$data)
    {
        return json([
            'code'=>$code,
            'msg'=>$msg,
            'data'=>$data
        ]);
    }
}
//成功
if(!function_exists('success')){
    function success($data,$code=200,$msg='')
    {
        return responses($code,$msg,$data);
    }
}
//失败
if(!function_exists('fail')){
    function fail($msg='',$code=500,$data=[])
    {
        return responses($code,$msg,$data);
    }
}
